Field of the Invention
This invention relates generally to multithreaded computer systems, and more specifically to a system and method for programmatic communication among threads of a multi-threaded system using inter-processor messages.
Description of the Related Art
Due to the complexity and energy concerns of modern processors, traditional approaches to boosting CPU performance have become difficult and ineffective. Instead of attempting to drive up clock speeds, computer architects are increasingly turning to multi-threading techniques such as symmetric multi-threading or multi-core architectures. In order to leverage these new architectures, software engineers must write applications that execute using multiple concurrent threads of execution.
Shared-memory systems may allow multiple threads of execution to access and operate on the same memory locations. Threads often employ shared memory for inter-thread communication. For instance, a given thread T1 may repeatedly poll a shared memory location A, for a message from another thread T2. At some point, T2 may write a value into memory location A. Subsequent to this write, T1 may read the value and respond according to its program logic.
In the above example, while T1 awaits the message from T2 to arrive in shared memory location A, T1 may be said to be “spinning on A.” Spinning on a memory location (i.e., a variable) is a common way for threads in a shared memory system to communicate. However, communication via shared memory in this traditional manner may be wasteful of system resources, such as system buses.